<%@page import="com.gqs.bookstore.dao.impl.CatalogDaoImpl"%>
<%@page import="com.gqs.bookstore.vo.Catalog"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<h3 class="page-header">
	分类维护 <small>修改书籍分类</small>
</h3>
	<%
		//修改这块必须是先查到才能修改
		String id = request.getParameter("id");
		Long idd = Long.parseLong(id);
		Catalog catalog = new CatalogDaoImpl().findById(idd);
	%>
	
		<form class="form-horizontal" method="post" action="do_update_catalog.jsp">
			<!-- id必须要传过去进行表单提交到目标页面进行计算，但是不必在前台展现出来，所以用了一个hidden的输入表单 -->
			<input type="hidden" name="id" value="<%=catalog.getId()%>">
		<div class="control-group">
			<label class="control-label">分类名称</label>
			<div class="controls">
				<input name="name" type="text" style="height:30px;"placeholder="<%=catalog.getName()%>"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">分类状态</label>
			<div class="controls">
				<input name="status" type="text" style="height:30px;"placeholder="<%=catalog.getStatus() == 0 ? "禁用" : "启用"%>"/>
			</div>
		</div>
		
		<div class="form-actions">
			<input class="btn btn-primary" type="submit" value="修改">
			<a class="btn" href="index.jsp">取消</a>
		</div>
		</form>
</body>
</html>